class BookmarksController < ApplicationController

  def create
    exist = Bookmark.find_by_user_id_and_task_id(current_user.id,params[:task_id])
    Bookmark.create(:user_id=>current_user.id, :project_id=>params[:project_id], :task_id=>params[:task_id]) if not exist
    render(:nothing=>true)
  end

  def list
    render(:partial=>'bookmarks/bookmark', :collection=>current_user.bookmarks)
  end
  
  def destroy
    Bookmark.destroy(params[:id].to_i)
    render(:nothing=>true)
  end
  
end

